<?php 

namespace app\controller\bossManager;

use app\service\UrlConfigService;
use ReflectionClass;
use share\service\cache\CommonCacheKeyService;
use share\service\cache\DBCacheStringService;

class CacheManagerController extends WebBossController{


    /**
     * 通用缓存
     */
    public function common_cache_list_action(){  
        $rKeyClass = new ReflectionClass(CommonCacheKeyService::class);
        $constants = $rKeyClass->getConstants();
        $res = [];
        foreach($constants as $key => $val){
            $res[] = [
                'key' => $val,
                'name' => $key,
            ];
        }
        return self::ok($res);        
    }

    /**
     * db缓存
     */
    public function db_cache_list_action(){  
        return self::ok(DBCacheStringService::getAllCacheConfig());
    }


    /**
     * 获取通用缓存
     */
    public function get_common_cache_info_action(){  
        return self::ok(UrlConfigService::getDescSelectorTypeList());
    }

    /**
     * 获取db缓存
     */
    public function get_db_cache_info_action(){

    }

    /**
     * 删除通用缓存
     */
    public function del_common_cache_info_action(){  
        return self::ok(UrlConfigService::getDescSelectorTypeList());
    }

    /**
     * 删除db缓存
     */
    public function del_db_cache_info_action(){

    }
}